﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using r4u.business.logic.layer.RECRUIT;
using r4u.data.access.layer;

namespace r4u.business.logic.layer.ASSESS
{
    public class Evaluate
    {
        public Ranking[] RankApplicants(Criteria criteria)
        {
            List<Ranking> list = new List<Ranking>();
            Vacancy temp = new Vacancy();
            VACANCY vacancy = temp.GetVacancyWithSkills(criteria.vacancyId);
            Candidate[] candidates = temp.GetApplicants(criteria.vacancyId);


            foreach (Candidate c in candidates)
            {
                Ranking ranking = new Ranking(vacancy, c, criteria);
                list.Add(ranking);
            }

            return list.OrderByDescending(c => c.score).ToArray();

        }
    }
}
